package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"github.com/liangchao/blogo/src/admin/routers"
	"github.com/liangchao/blogo/src/common/global"
	"github.com/liangchao/blogo/src/common/initialize"
	"log"
)

func init() {
	initialize.InitConfig("conf/dev.app.yaml")

	initialize.InitLogger()

	initialize.InitMysqlDB()

	log.Println(global.Settings.RedisInfo)
	initialize.InitRedis()

}

func main() {
	r := gin.Default()

	r.SetTrustedProxies(nil)

	routers.SetupRouter(r)

	r.Run(fmt.Sprintf(":%d", global.Settings.Port))
}
